package edu.eam.paii.proyecto.entidades;

import java.io.Serializable;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;

@Entity
/**
 * @author Hector Bedoya Ortegon
 * @author Felipe Suarez Bedoya
 * Esta entidad permite administrar toda la informacion de una tarjeta de credito. 
 **/

/**
 * Name quevery 
 */
@NamedQueries(value = { @NamedQuery(name="Tarjeta_Credito.listar", 
		query="select T from Tarjeta_Credito T"),
		
	
})
public class Tarjeta_Credito implements Serializable {
	@Id
	private int nro_Tarjeta;
	private double cupo;
	private double cupo_Usado;
	private int puntos;
	private String clave;

	@ManyToOne
	@JoinColumn(name = "id_Cliente")
	private Cliente clienteTarjetaCredito;

	@OneToMany(mappedBy = "tarjetaCreditoAvanse", fetch = FetchType.LAZY, cascade = CascadeType.ALL)
	private List<Avances> avanses;

	@OneToMany(mappedBy = "pagosTCredito", fetch = FetchType.LAZY, cascade = CascadeType.ALL)
	private List<Pago_TarjetaCredito> pagos_TarjetaCreditos;

	@OneToMany(mappedBy = "cuotaTCredito", fetch = FetchType.LAZY, cascade = CascadeType.ALL)
	private List<Cuota_TarjetaCredito> cuotas_TarjetaCreditos;

}
